home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 49
/
Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso
/
Aminet
/
util
/
boot
/
WBSP_Prefs.lha
/
WBStartup+Prefs
/
Source
/
CopyWindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
2002-03-05
|
4KB
|
133 lines
#include <exec/types.h>
#include <libraries/mui.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/muimaster.h>
#include "CopyWindow.h"
#include "WBStartup+Prefs.h"
#include "WBStartupPlusPrefs_Cat.h"
int CopyWindow(int flags)
{
/* RETURNS the new flags */
ULONG signals,returnid;
BOOL LOOP;
UBYTE *labels[3];
UBYTE *labels2[3];
ULONG active;
int newflags=0;
Object *cwindow,*cradio1,*cradio2,*cokobj,*ccancelobj;
labels[0]=(UBYTE *)GetString(STREnabled);
labels[1]=(UBYTE *)GetString(STRDisabled);
labels[2]=NULL;
labels2[0]=(UBYTE *)GetString(STRCopyFile);
labels2[1]=(UBYTE *)GetString(STRMoveFile);
labels2[2]=NULL;
cwindow=MUI_NewObject("Window.mui",MUIA_Window_RefWindow,winobj,
MUIA_Window_LeftEdge,MUIV_Window_LeftEdge_Centered,
MUIA_Window_TopEdge,MUIV_Window_TopEdge_Centered,
MUIA_Window_ID,3,
MUIA_Window_Title,GetString(STRAddPrograms),
MUIA_Window_RootObject,
MUI_NewObject("Group.mui",MUIA_Group_Child,
MUI_NewObject("Group.mui",MUIA_Background,MUII_GroupBack,
MUIA_Frame,MUIV_Frame_Group,
MUIA_FrameTitle,GetString(STRStatusOfPrograms),
MUIA_Group_Horiz,TRUE,
MUIA_Group_Child,
MUI_MakeObject(MUIO_HSpace,0),
MUIA_Group_Child,
cradio1=MUI_NewObject("Radio.mui",MUIA_Radio_Entries,labels,
MUIA_Radio_Active,(flags & WBSP_ENABLED) ? 0: 1,
MUIA_CycleChain,TRUE,
TAG_DONE),
MUIA_Group_Child,
MUI_MakeObject(MUIO_HSpace,0),
TAG_DONE),
MUIA_Group_Child,
MUI_NewObject("Group.mui",MUIA_Background,MUII_GroupBack,
MUIA_Frame,MUIV_Frame_Group,
MUIA_FrameTitle,GetString(STROperation),
MUIA_Group_Horiz,TRUE,
MUIA_Group_Child,
MUI_MakeObject(MUIO_HSpace,0),
MUIA_Group_Child,
cradio2=MUI_NewObject("Radio.mui",MUIA_Radio_Entries,labels2,
MUIA_Radio_Active,(flags & WBSP_MOVE) ? 1 : 0,
MUIA_CycleChain,TRUE,
TAG_DONE),
MUIA_Group_Child,
MUI_MakeObject(MUIO_HSpace,0),
TAG_DONE),
MUIA_Group_Child,
MUI_NewObject("Group.mui",MUIA_Group_Horiz,TRUE,
MUIA_Group_Child,
cokobj=MUI_NewObject("Text.mui",MUIA_CycleChain,TRUE,
MUIA_Frame,MUIV_Frame_Button,
MUIA_Background,MUII_ButtonBack,
MUIA_InputMode,MUIV_InputMode_RelVerify,
MUIA_Text_Contents,GetString(STROk),
MUIA_Text_PreParse,"\33c",
TAG_DONE),
MUIA_Group_Child,
ccancelobj=MUI_NewObject("Text.mui",MUIA_CycleChain,TRUE,
MUIA_Frame,MUIV_Frame_Button,
MUIA_Background,MUII_ButtonBack,
MUIA_InputMode,MUIV_InputMode_RelVerify,
MUIA_Text_Contents,GetString(STRCancel),
MUIA_Text_PreParse,"\33c",
TAG_DONE),
TAG_DONE),
TAG_DONE),
TAG_DONE);
if (!cwindow)
return(WBSP_CANCEL);
DoMethod(appobj,OM_ADDMEMBER,cwindow);
DoMethod(cwindow,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,appobj,2,MUIM_Application_ReturnID,1);
DoMethod(ccancelobj,MUIM_Notify,MUIA_Pressed,FALSE,appobj,2,MUIM_Application_ReturnID,1);
DoMethod(cokobj,MUIM_Notify,MUIA_Pressed,FALSE,appobj,2,MUIM_Application_ReturnID,2);
SetAttrs(cwindow,MUIA_Window_Open,TRUE,TAG_DONE);
signals=0;
LOOP=TRUE;
while (LOOP)
{
if (signals)
signals=Wait(signals);
returnid=DoMethod(appobj,MUIM_Application_NewInput,&signals);
switch (returnid)
{
case 1:
newflags |= WBSP_CANCEL;
LOOP=FALSE;
break;
case 2:
LOOP=FALSE;
break;
case MUIV_Application_ReturnID_Quit:
newflags |= WBSP_CANCEL;
DoMethod(appobj,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
LOOP=FALSE;
break;
}
}
GetAttr(MUIA_Radio_Active,cradio1, &active);
if (!active)
newflags |= WBSP_ENABLED;
GetAttr(MUIA_Radio_Active,cradio2, &active);
if (active)
newflags |= WBSP_MOVE;
SetAttrs(cwindow,MUIA_Window_Open,FALSE,TAG_DONE);
DoMethod(appobj,OM_REMMEMBER,cwindow);
MUI_DisposeObject(cwindow);
return(newflags);
}